package com.newlink.building.common_base.event

import com.newlink.building.common_base.utils.MqttDoorOperator.MSGTYPE_ALARM_HANDLE
import com.newlink.building.common_base.utils.MqttDoorOperator.MSGTYPE_ARMING_ACT
import java.io.Serializable
import java.text.SimpleDateFormat
import java.util.Date

/**
 * @Author: Jake
 * @Date: 2023-05-11
 * @Description:
 */
class HandleEmergencyActionEvent(var userId: Long, var bean: HandleEmergencyActionBean)

data class HandleEmergencyActionBean(
    val currentTime: String,
    val `data`: Data,
    val msgType: String,
    val version: String,
    val msgId: String
) : Serializable {
    data class Data(
        val handleMsg: Boolean,
        val deviceName: String,
        val emergencyType: Int,
        val mac: String

    ) : Serializable
}

//class HandleAlarmActionEvent(var userId: Long, var bean: HandleAlarmActionBean)
//
//data class HandleAlarmActionBean(
//    val currentTime: String,
//    val `data`: Data,
//    val msgType: String,
//    val version: String,
//    val msgId: String
//) : BaseActionBean, Serializable {
//    data class Data(
//        val logAlarmId: String
//    ) : Serializable
//}


//{
//    "version": "1.0.0",
//    "msgType": "app_alarm_handle",
//    "currentTime": "2023-04-10T16:37:21+08:00",
//    "msgId": "app_xxxxxxxx",
//    "data": {
//    "logAlarmId": 123123123
//}


data class HandleAlarmActionRequest(
    val version: String = "1.0.0",
    val msgType: String = MSGTYPE_ALARM_HANDLE,
    val currentTime: String = SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssZ").format(Date()),
    val msgId: String = "app_${System.currentTimeMillis()}",
    val `data`: Data
) : BaseActionBean, Serializable {
    data class Data(
        val logAlarmId: Long
    ) : Serializable
}

data class SetSecurityModelRequest(
    val msgType: String = MSGTYPE_ARMING_ACT,
    val currentTime: String = SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssZ").format(Date()),
    val msgId: String = "app_${System.currentTimeMillis()}",
    val data: Data,
) : BaseApiVersionBean() {
    data class Data(
        val mac: String,
        val mode: Int,
    ) : Serializable
}

